package cn.yshujia.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * @author YShuJia
 * @create 2024/4/23
 * @description 实体
 */

@Data
@TableName ("t_role")
@Schema (name = "Role", description = "角色")
public class Role implements Serializable {
	@Serial
	private static final long serialVersionUID = 1L;
	
	@Schema (description = "自增主键")
	@TableId (value = "id", type = IdType.AUTO)
	private Long id;
	
	@Schema (description = "角色名称")
	@TableField ("`name`")
	private String name;
	
	@Schema (description = "权限字符")
	@TableField ("permission")
	private String permission;
	
	@Schema (description = "需要的经验值")
	@TableField ("experience")
	private Integer experience;
	
	@Schema (description = "创建时间")
	@TableField (value = "create_time", fill = FieldFill.INSERT)
	@JsonFormat (pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date createTime;
	
	@Schema (description = "状态（1 启用）")
	@TableField ("`status`")
	private Boolean status;
}
